package com.zyf.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zyf.user.mapper.UserMapper;
import com.zyf.user.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class Userservice {


    @Autowired
    UserMapper userMapper;
    public String add(String name){
        return  "添加"+ name+ "成功";
    }
    public User get(String name){
        User user = new User();
        user.setName(name);
        Map<String, Object> map = new HashMap<>();
        map.put("name_",name);
        return userMapper.selectByMap(map).get(0);
     //   return  userMapper.selectOne(new QueryWrapper<>(user));
    }
}
